<?php
require_once 'adminmenu.php';
?>
<script> 
/* when document is ready */
$(function() {
    /* initiate plugin */
    $("div.holder").jPages({
        containerID: "itemContainer"
    });
});
</script>
<ul id="itemContainer" class="list-no-bullet">
<?php
$content = new Models_User();
$users = $content->getNewUsers();
foreach ($users as $user)
{
    $userData = $content->getUserData($user['id']);
    $userRoles = $content->getUserRoles($user['id']);
?>
    <li><div class="well">
        <div class="row">
            <div class="span1"><a href="#" class="thumbnail"><img src="/<?php $content->printPath(); ?>public/img/user/userpic.jpg" alt="user"></a></div>
            <div class="span7">
                <p><i class="icon-user"></i> <?php echo $user['login']; ?></p>
                <strong><p><?php echo $userData['first_name'] . '  ' . $userData['second_name']; ?></p></strong>
                <div class="form-horizontal">
                      <div class="control-group">
                        <label class="control-label">e-mail:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['email']; ?></span>
                        </div>
                      </div>
                     <div class="control-group">
                        <label class="control-label">skype:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['skype']; ?></span>
                        </div>
                      </div>
                     <div class="control-group">
                        <label class="control-label">icq:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['icq']; ?></span>
                        </div>
                      </div>
                      <div class="control-group">
                          <div class="well"><?php echo $userData['info']; ?></div>
                          <div class="well"><i class="icon-lock"></i> Roles: <?php 
                                foreach ($userRoles as $role)
                                {
                                    echo '<span class="label label-info">' . $role['name'] . '</span> ';
                                }
                          ?></div>
                      </div>
                      <div class="form-actions">
                         <a class="btn btn-primary" href="/<?php $content->printPath(); ?>admin/edituserrole/<?php echo $user['id']; ?>"><i class="icon-pencil icon-white"></i> Edit roles</a>
                         <a class="btn btn-success" href="/<?php $content->printPath(); ?>admin/activateuser/<?php echo $user['id']; ?>"><i class="icon-ok icon-white"></i> Set Active</a>
                         <a class="btn btn-danger" href="/<?php $content->printPath(); ?>admin/removeuser/<?php echo $user['id']; ?>"><i class="icon-remove icon-white"></i> Delete</a>
                      </div>
                  </div>
            </div>
    </div>
    </div></li>
<?php
}
?>
</ul>
<!-- navigation panel -->
    <div class="holder pagination">
        <a class="jp-previous jp-disabled">← previous</a>
        <a class="jp-current">1</a>
        <span class="jp-hidden">...</span>
        <a>2</a>
        <a>3</a>
        <a>4</a>
        <a>5</a>
        <a class="jp-hidden">6</a>
        <a class="jp-hidden">7</a>
        <a class="jp-hidden">8</a>
        <a class="jp-hidden">9</a>
        <span>...</span>
        <a>10</a>
        <a class="jp-next">next →</a>
    </div>